package com.cictec.middleware.core.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.cictec.middleware.commons.utils.DateUtils;

@Table(name = "t_sign_in")
public class BusDriverSignIn implements Serializable {
	
	@Transient
	private String drvName;
	@Transient
	private String busUuid;
	
    public String getDrvName() {
		return drvName;
	}

	public void setDrvName(String drvName) {
		this.drvName = drvName;
	}
	public String getBusUuid() {
		return busUuid;
	}

	public void setBusUuid(String busUuid) {
		this.busUuid = busUuid;
	}

	/**
	 * 获取签到时间
	 * @return
	 */
    public Date getDrvSignTime() {
    	if(signTime != null){
    		if(signTime.length() == 23){
    			return DateUtils.parseDateTimes(this.signTime);
    		}else if(signTime.length() == 20){
    			return DateUtils.parseDateTime(this.signTime);
    		}
    	}
    	return null;
	}



	/**
     * 主键
     */
    @Id
    @Column(name = "sign_uuid")
    private String signUuid;

    /**
     * 线路uuid
     */
    @Column(name = "sign_line_uuid")
    private String signLineUuid;

    /**
     * 设备uuid
     */
    @Column(name = "sign_dev_uuid")
    private String signDevUuid;

    /**
     * 司机uuid
     */
    @Column(name = "sign_drv_uuid")
    private String signDrvUuid;

    /**
     * 司机卡号
     */
    @Column(name = "sign_card_id")
    private String signCardId;

    /**
     * 签到时间
     */
    @Column(name = "sign_time")
    private String signTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取主键
     *
     * @return sign_uuid - 主键
     */
    public String getSignUuid() {
        return signUuid;
    }

    /**
     * 设置主键
     *
     * @param signUuid 主键
     */
    public void setSignUuid(String signUuid) {
        this.signUuid = signUuid == null ? null : signUuid.trim();
    }

    /**
     * 获取线路uuid
     *
     * @return sign_line_uuid - 线路uuid
     */
    public String getSignLineUuid() {
        return signLineUuid;
    }

    /**
     * 设置线路uuid
     *
     * @param signLineUuid 线路uuid
     */
    public void setSignLineUuid(String signLineUuid) {
        this.signLineUuid = signLineUuid == null ? null : signLineUuid.trim();
    }

    /**
     * 获取设备uuid
     *
     * @return sign_dev_uuid - 设备uuid
     */
    public String getSignDevUuid() {
        return signDevUuid;
    }

    /**
     * 设置设备uuid
     *
     * @param signDevUuid 设备uuid
     */
    public void setSignDevUuid(String signDevUuid) {
        this.signDevUuid = signDevUuid == null ? null : signDevUuid.trim();
    }

    /**
     * 获取司机uuid
     *
     * @return sign_drv_uuid - 司机uuid
     */
    public String getSignDrvUuid() {
        return signDrvUuid;
    }

    /**
     * 设置司机uuid
     *
     * @param signDrvUuid 司机uuid
     */
    public void setSignDrvUuid(String signDrvUuid) {
        this.signDrvUuid = signDrvUuid == null ? null : signDrvUuid.trim();
    }

    /**
     * 获取司机卡号
     *
     * @return sign_card_id - 司机卡号
     */
    public String getSignCardId() {
        return signCardId;
    }

    /**
     * 设置司机卡号
     *
     * @param signCardId 司机卡号
     */
    public void setSignCardId(String signCardId) {
        this.signCardId = signCardId == null ? null : signCardId.trim();
    }

    /**
     * 获取签到时间
     *
     * @return sign_time - 签到时间
     */
    public String getSignTime() {
        return signTime;
    }

    /**
     * 设置签到时间
     *
     * @param signTime 签到时间
     */
    public void setSignTime(String signTime) {
    	if(signTime != null){
    		this.signTime = signTime.trim();
    	}else{
    		this.signTime = null;
    	}
    }


	@Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", signUuid=").append(signUuid);
        sb.append(", signLineUuid=").append(signLineUuid);
        sb.append(", signDevUuid=").append(signDevUuid);
        sb.append(", signDrvUuid=").append(signDrvUuid);
        sb.append(", signCardId=").append(signCardId);
        sb.append(", signTime=").append(signTime);
        sb.append("]");
        return sb.toString();
    }
}